<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{csrf_token()}}">
    <title>@yield('title')</title>
    <link rel="stylesheet" href="/plugins/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/dist/css/adminlte.min.css">
    <link rel="stylesheet" href="/plugins/toastr/toastr.min.css">
    @yield('css')
</head>


<body class="hold-transition sidebar-mini layout-fixed">

<div class="wrapper">

    @include('admin::layouts.nav')

    <aside class="main-sidebar sidebar-dark-primary elevation-4">
        <a href="{{route('admin.index')}}" class="brand-link">
            <img src="/dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
            <span class="brand-text font-weight-light">后台管理系统</span>
        </a>
        <div class="sidebar">
            @include('admin::layouts.sidebar')
        </div>
    </aside>

    <div class="content-wrapper">

        <div class="content-header">
            <div class="container-fluid">
                @yield('nav')
            </div>
        </div>

        <section class="content">
            <div class="container-fluid">
                @yield('content')
            </div>
        </section>

    </div>

    <footer class="main-footer">
        <strong>Copyright &copy; 2020-2030</strong>
        All rights reserved.
    </footer>
</div>



<script src="/plugins/jquery/jquery.min.js"></script>
<script src="/plugins/jquery-ui/jquery-ui.min.js"></script>
<script src="/plugins/toastr/toastr.min.js"></script>
<script src="/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/dist/js/adminlte.js"></script>

<script>

    $(function(){

        $('.subLink').each(function(){
            if ($(this).hasClass('active')){
                $(this).parent().parent().parent().find('.first').addClass('active');
                $(this).parent().parent().parent().addClass('menu-open');
            }
        });

        $.widget.bridge('uibutton', $.ui.button)

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });

        toastr.options = {
            progressBar: false,
            positionClass: "toast-top-center",
            onclick: null,
            showDuration: "300",
            hideDuration: "1000",
            timeOut: "2000",
            extendedTimeOut: "1000",
            showEasing: "swing",
            hideEasing: "linear",
            showMethod: "fadeIn",
            hideMethod: "fadeOut"
        };

        @if(count($errors) > 0)
            @foreach($errors->all() as $error)
                toastr.error("{{$error}}");
            @endforeach
        @endif

        //一次性正确信息提示
        @if(session('success'))
            toastr.success("{{session('success')}}");
        @endif
    });

</script>


@yield('js')


</body>
</html>
